<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>应收库存</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            text-align: left;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px;
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        span.lineOne {
            line-height: 20px;
            height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
            margin-bottom: 10px;
            padding-bottom: 10px;
            margin-top: 1px;
        }

        .table > thead > tr > th {
            padding: 0;
            border-left:none;
            border-right: none;
        }

        .table > tbody > tr > td {
            position: relative;
            border-left:none;
            border-right: none;
        }
        table.table-bordered{
            margin-bottom: 0 !important;
            border-left:1px solid  #cbcbcd !important;
            border-right:1px solid  #cbcbcd !important;
        }
        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
            height: 30px;
        }
    </style>
</head>
<body>
<section class="content" id="app">
    <div class="div-td-content-more"><i></i></div>
    <div class="templateStyle">
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" >新机库存</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <table class="table table-hover table-bordered text-center" style="table-layout: fixed;">
                <thead>
                <tr>
                    <th style="width: 90px">提车公司</th>
                    <th style="width: 101px">品牌</th>
                    <th style="width: 90px">库存地</th>
                    <th style="width: 80px">状态</th>
                    <th style="width: 99px">机型</th>
                    <th style="width: 80px">出厂日期</th>
                    <th style="width: 194px">斗容</th>
                    <th style="width: 140px">序列号</th>
                    <th>备注</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,i) in list1">
                    <td>{{item.companyName}}</td>
                    <td>{{item.brandName}}</td>
                    <td class="td-tanZongStyle-line"><span v-html="showDz(item)"></span></td>
                    <td v-if="showToday(item)" style="color: red">{{item.state}}</td>
                    <td v-else>{{item.state}}</td>
                    <td>{{item.modelName}}</td>
                    <td>{{item.pickUpDate}}</td>
                    <td>{{item.bucketType}}</td>
                    <td @click="gotoDetailSel(item.id)" style="color: #2a8cec;cursor: pointer;">{{item.sequence}}</td>
                    <td class="td-tanZongStyle-line" style="border-left:1px solid #cbcbcd;"><span class="lineOne">{{item.remark}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" >旧机库存</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <table class="table table-hover table-bordered text-center" style="table-layout: fixed;">
                <thead>
                <tr>
                    <th style="width: 90px">归属公司</th>
                    <th style="width: 101px">品牌</th>
                    <th style="width: 90px">库存地</th>
                    <th style="width: 80px">状态</th>
                    <th style="width: 99px">机型</th>
                    <th style="width: 80px">出厂日期</th>
                    <th style="width: 94px">小时数</th>
                    <th style="width: 100px">评估价格</th>
                    <th style="width: 140px">序列号</th>
                    <th>备注</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,i) in list2">
                    <td>{{item.companyName}}</td>
                    <td>{{item.brandName}}</td>
                    <td class="td-tanZongStyle-line"><span v-html="showDz(item)"></span></td>
                    <td>{{item.state}}</td>
                    <td>{{item.modelName}}</td>
                    <td>{{item.factoryDate!=''?item.factoryDate+'年':''}}</td>
                    <td>{{item.hours}}</td>
                    <td>{{item.estimatePrice?fmoney(item.estimatePrice):"-"}}</td>
                    <td @click="gotoDetail(item.id,'look',0)" style="color:#2a8cec;cursor: pointer;">{{item.sequence=='无'?'-':item.sequence}}</td>
                    <td class="td-tanZongStyle-line" style="border-left:1px solid #cbcbcd;"><span>{{item.remark}}</span></td>
                </tr>
                </tbody>
            </table>

        </div>
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" >置换房产</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <table class="table table-hover table-bordered text-center" style="table-layout: fixed;">
                <thead>
                <tr>
                    <th style="width: 90px">归属公司</th>
                    <th style="width: 101px">房屋名称</th>
                    <th style="width: 170px">房屋位置</th>
                    <th style="width: 99px">状态</th>
                    <th style="width: 274px">楼号、单元</th>
                    <th style="width: 140px">面积(m²)</th>
                    <th>备注</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,i) in list3">
                    <td>{{item.companyName}}</td>
                    <td class="td-tanZongStyle-line" @click="gotoDetailHouse(item.id,'look',0)" style="color:#2a8cec;cursor: pointer;"><span>{{item.houseName}}</span></td>
                    <td class="td-tanZongStyle-line"><span>{{item.houseAddress}}</span></td>
                    <td>{{item.state}}</td>
                    <td>{{item.buildingNumber}}</td>
                    <td>{{item.area}}</td>
                    <td style="border-left:1px solid #cbcbcd;"><span class="lineOne">{{item.remark}}</span></td>
                </tr>
                </tbody>
            </table>

        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script src="/dist/plugins/select2/select2.full.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    function refresh() {
        $.wyui.page.getByPage();
    }
    var app = new Vue({
        el: '#app',
        data: {
            list1:[],
            list2:[],
            list3:[],
        },
        methods: {
            showToday:function (item) {
                var dateTime = new Date().Format("yyyy-MM-dd");
               if(dateTime==item.updateTime){
                   return true;
               }
            },
            showDz: function (item) {
                var html = item.storeAddress;
                if(html=="直发客户交机"){
                    return html;
                }
                else{
                    var sta=html.indexOf("省");
                    var pos=html.indexOf("市");
                    return html.substring(sta+1,pos+1);
                }
            },
            gotoDetailSel: function (id) {
                top.$.dialog({
                    content: 'url:/page/device/sample/detail_new.html?pageType=look&&id=' + id,
                    title: "新机详情",
                    width: 904,
                    height:565,
                    max: true,
                    min: true,
                    lock: true
                })
            },
            gotoDetail: function (id, pageType, isAdd) {
                top.$.dialog({
                    content: 'url:/page/device/sample/oldSampleDetail.html?pageType=' + pageType + "&&id=" + id + "&&isAdd=" + isAdd,
                    title: '旧机入库',
                    width: 904,
                    height: 535,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            gotoDetailHouse: function (id, pageType,isAdd) {
                var title="";
                if(pageType=="edit"){
                    if(isAdd=="0"){
                        title="房屋编辑"
                    }else if(isAdd=="1"){
                        title="房屋入库"
                    }
                }else{
                    title="房屋详情"
                }
                top.$.dialog({
                    content: 'url:/page/device/sample/houseDetail.html?pageType=' + pageType + "&&id=" + id+"&&isAdd="+isAdd,
                    title: title,
                    width: 904,
                    height: 535,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            /*数字判断限制*/
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            getList:function () {
                var that = this;
                $.wyui.postMethod('/deviceSample/selectStockList.json',{userId:getCurrentUser().id},function (r) {
                    console.log(r);
                    that.list1 = r.newSample;
                    that.list2 = r.oldSample;
                    that.list3 = r.oldHouse;
                })
            },
        },
        mounted: function () {
            //查询用户有哪些权限
            var that = this;
            that.getList();
        }
    });
</script>
</body>
</html>